/*
 * @Author: guandeshen 295570679@qq.com
 * @Date: 2024-05-19 12:23:55
 * @LastEditors: guandeshen 295570679@qq.com
 * @LastEditTime: 2024-08-30 11:23:44
 * @FilePath: /task-admin/src/api/wbs/index.ts
 * @Description:
 *
 * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved.
 */
import request from "@/utils/request";
import {
  WBSList,
  WBSQuery,
  WBSForm,
  WBSProjectQuery,
  WBSProjectList,
  detailQuery,
} from "./model";
class WBSAPI {
  /**
   * 获取分页列表
   *
   * @data data
   */
  static getPage(data: WBSQuery) {
    return request<any, PageResult<WBSList[]>>({
      url: "/tenant/wbs/index",
      method: "post",
      data: data,
    });
  }

  /**
   * 详情
   *
   * @data data
   */

  static detail(data: detailQuery) {
    return request<any, WBSForm>({
      url: "/tenant/wbs/detail",
      method: "post",
      data: data,
    });
  }

  static add(data: WBSForm) {
    return request({
      url: "/tenant/wbs/edit",
      method: "post",
      data: data,
    });
  }

  /**
   * 删除
   *
   * @data data
   */

  static deleteByIds(data: Ids) {
    return request({
      url: "/tenant/wbs/del",
      method: "post",
      data: data,
    });
  }

  /**
   * 项目列表
   *
   * @data data
   */
  static projectsList(data: WBSProjectQuery) {
    return request<any, PageResult<WBSProjectList[]>>({
      url: "/tenant/wbs/projects",
      method: "post",
      data: data,
    });
  }
}

export default WBSAPI;
